import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Login',
        component: () => import('@/views/login.vue'),
    },
    {
        path: '/home',
        name: '系统首页',
        component: () => import("../views/Manage.vue"),
        children: [
            {
                name:"进货订单",
                path:"/pur",
                component:() =>import("../views/Purchaseorders.vue"),
            },
            {
                name:"进货退货",
                path:"/ptr",
                component:() =>import("../views/purchasereturn.vue"),
            },
            {
                name:"销售订单",
                path:"/sal",
                component:() =>import("../views/salesorder.vue"),
            },
            {
                name:"销售退货",
                path:"/sai",
                component:() =>import("../views/Salesreturn.vue"),
            },
            {
                name:"入库管理",
                path:"/poi",
                component:() =>import("../views/poInbound.vue"),
            },
            {
                name:"出库管理",
                path:"/poo",
                component:() =>import("../views/pooutbound.vue"),
            },
            {
                name:"仓库调拨",
                path:"/ck",
                component:() =>import("../views/syskcallot.vue"),
            },
            {
                path: '/updatepassword',
                name: '修改密码',
                component: () => import("../views/UpdatePassword.vue"),
            },
            {
                path: '/personalcenter',
                name: '个人中心',
                component: () => import("../views/PersonalCenter.vue"),
            },
            {
                path: '/organizationalStructure',
                name: '组织机构',
                component: () => import("../views/OrganizationalStructure.vue"),
            },
            {
                path: '/positionManagement',
                name: '岗位管理',
                component: () => import("../views/PositionManagement.vue"),
            },
            {
                path: '/roles',
                name: '角色管理',
                component: () => import("../views/Roles.vue"),
            },
            {
                path: '/inventorytype',
                name: '出入库类型',
                component: () => import("../views/Inventorytype.vue"),
            },
            {
                path: '/dictionary',
                name: '数据字典',
                component: () => import("../views/Dictionary.vue"),
            },
          {
            path: '/dictionary/:type', // 定义带参数的路由，:type 将被替换为具体的字典类型
            name: '数据字典从表',
            component:  () => import("../views/Subordinate.vue"),
            props: true // 将路由参数传递为组件的属性
          },
          {
            path: '/suppliermanagement',
            name: '供应商管理',
            component: () => import("../views/Suppliermanagement.vue"),
        },
        {
            path: '/customermanagement',
            name: '客户管理',
            component: () => import("../views/Customermanagement.vue"),
        },
        {
            path: '/productType',
            name: '货品类型',
            component: () => import("../views/ProductType.vue"),
        },
        {
            path: '/product_info',
            name: '货品信息',
            component: () => import("../views/Product_info.vue"),
        },
        {
            path: '/inventory',
            name: '库存盘点',
            component: () => import("../views/Inventory.vue"),
        },
        {
            path: '/warehouse',
            name: '仓库管理',
            component: () => import("../views/warehouse.vue"),
        },
        ]
    }
]

const router = new VueRouter({
    routes
})

export default router;